/**
 * Copyright (c) Software Institute of PKU
 * All rights reserved. 
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 */
package edu.pku.sei.modeler.project;

import java.util.Hashtable;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectNature;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.PlatformObject;

import edu.pku.sei.modeler.exceptions.ProjectLoadingException;
import edu.pku.sei.modeler.exceptions.ProjectSavingException;
import edu.pku.sei.modeler.model.core.MetaModel;

/**
 * @author zl
 *
 */
public abstract class AbstractModelingProject extends PlatformObject implements
		IProjectNature {
	protected IProject project;
	public String modelFile = "model.model";
	public String notationFile = "model.notation";
	public String diagramFile = "model.diagram";
	public static String COMMON_NATURE = "edu.pku.modeler.ModelingNature";
	
	protected Hashtable diagramEditorMap = new Hashtable();
	
	abstract public void saveProject() throws ProjectSavingException;
	abstract public void loadProject() throws ProjectLoadingException;
	abstract public boolean hasDiagram(Object diagram);
	abstract public void openDiagram(Object diagram);
	abstract public void closeDiagram(Object diagram,boolean save);
	abstract public MetaModel getModel();
	/* (non-Javadoc)
	 * @see org.eclipse.core.resources.IProjectNature#configure()
	 */
	public void configure() throws CoreException {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see org.eclipse.core.resources.IProjectNature#deconfigure()
	 */
	public void deconfigure() throws CoreException {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see org.eclipse.core.resources.IProjectNature#getProject()
	 */
	public IProject getProject() {
		return project;
	}

	/* (non-Javadoc)
	 * @see org.eclipse.core.resources.IProjectNature#setProject(org.eclipse.core.resources.IProject)
	 */
	public void setProject(IProject project) {
		this.project = project;
	}

}
